home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / BlobMgr / Library Folder / CalcRegion.c next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  530 b   |  25 lines  |  [TEXT/KAHL]

  1. # include    "BlobMgr.h"
  2.  
  3.  
  4. /*
  5.  * Return copy of the region corresponding to the part code.  The
  6.  * caller is responsible for disposing of the region that is returned.
  7.  */
  8.  
  9. pascal RgnHandle
  10. BCalcRegion (BlobHandle b, short partCode)
  11. {
  12. RgnHandle    rgn;
  13.  
  14.     rgn = NewRgn ();
  15.     if (partCode == inDragBlob)                /* drag region only */
  16.         CopyRgn ((**b).dragRgn, rgn);
  17.     else                                    /* static or static+drag=full region */
  18.     {
  19.         CopyRgn ((**b).statRgn, rgn);
  20.         if (partCode == inFullBlob)
  21.             UnionRgn ((**b).dragRgn, rgn, rgn);
  22.     }
  23.     return (rgn);
  24. }
  25.